{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2023-05-11T15:15:18.969132800Z",
     "start_time": "2023-05-11T15:15:16.268088600Z"
    }
   },
   "outputs": [],
   "source": [
    "import random\n",
    "import torch\n",
    "from d2l import torch as d2l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "[('the', 2261),\n ('i', 1267),\n ('and', 1245),\n ('of', 1155),\n ('a', 816),\n ('to', 695),\n ('was', 552),\n ('in', 541),\n ('that', 443),\n ('my', 440)]"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tokens = d2l.tokenize(d2l.read_time_machine())\n",
    "# 因为每个⽂本⾏不⼀定是⼀个句⼦或⼀个段落，因此我们把所有⽂本⾏拼接到⼀起\n",
    "corpus = [token for line in tokens for token in line]\n",
    "vocab = d2l.Vocab(corpus)\n",
    "vocab.token_freqs[:10]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T15:15:47.449334100Z",
     "start_time": "2023-05-11T15:15:47.392339400Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 350x250 with 1 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"247.978125pt\" height=\"183.35625pt\" viewBox=\"0 0 247.978125 183.35625\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2023-05-11T23:16:53.602962</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 183.35625 \nL 247.978125 183.35625 \nL 247.978125 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 45.478125 145.8 \nL 240.778125 145.8 \nL 240.778125 7.2 \nL 45.478125 7.2 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <path d=\"M 54.355398 145.8 \nL 54.355398 7.2 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_2\">\n      <defs>\n       <path id=\"md974802b97\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#md974802b97\" x=\"54.355398\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- $\\mathdefault{10^{0}}$ -->\n      <g transform=\"translate(45.555398 160.398438)scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_3\">\n      <path d=\"M 102.85613 145.8 \nL 102.85613 7.2 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_4\">\n      <g>\n       <use xlink:href=\"#md974802b97\" x=\"102.85613\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- $\\mathdefault{10^{1}}$ -->\n      <g transform=\"translate(94.05613 160.398438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(128.203125 38.965625)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_5\">\n      <path d=\"M 151.356861 145.8 \nL 151.356861 7.2 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_6\">\n      <g>\n       <use xlink:href=\"#md974802b97\" x=\"151.356861\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- $\\mathdefault{10^{2}}$ -->\n      <g transform=\"translate(142.556861 160.398438)scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_7\">\n      <path d=\"M 199.857593 145.8 \nL 199.857593 7.2 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_8\">\n      <g>\n       <use xlink:href=\"#md974802b97\" x=\"199.857593\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- $\\mathdefault{10^{3}}$ -->\n      <g transform=\"translate(191.057593 160.398438)scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-33\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_9\">\n      <defs>\n       <path id=\"m07d6328747\" d=\"M 0 0 \nL 0 2 \n\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"46.842539\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_10\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"49.655191\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_7\">\n     <g id=\"line2d_11\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"52.136126\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_8\">\n     <g id=\"line2d_12\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"68.955573\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_9\">\n     <g id=\"line2d_13\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"77.496128\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_10\">\n     <g id=\"line2d_14\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"83.555748\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_11\">\n     <g id=\"line2d_15\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"88.255954\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_12\">\n     <g id=\"line2d_16\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"92.096303\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_13\">\n     <g id=\"line2d_17\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"95.343271\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_14\">\n     <g id=\"line2d_18\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"98.155923\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_15\">\n     <g id=\"line2d_19\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"100.636858\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_16\">\n     <g id=\"line2d_20\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"117.456305\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_17\">\n     <g id=\"line2d_21\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"125.99686\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_18\">\n     <g id=\"line2d_22\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"132.05648\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_19\">\n     <g id=\"line2d_23\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"136.756686\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_20\">\n     <g id=\"line2d_24\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"140.597035\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_21\">\n     <g id=\"line2d_25\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"143.844003\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_22\">\n     <g id=\"line2d_26\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"146.656655\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_23\">\n     <g id=\"line2d_27\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"149.13759\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_24\">\n     <g id=\"line2d_28\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"165.957036\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_25\">\n     <g id=\"line2d_29\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"174.497591\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_26\">\n     <g id=\"line2d_30\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"180.557211\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_27\">\n     <g id=\"line2d_31\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"185.257418\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_28\">\n     <g id=\"line2d_32\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"189.097766\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_29\">\n     <g id=\"line2d_33\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"192.344735\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_30\">\n     <g id=\"line2d_34\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"195.157387\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_31\">\n     <g id=\"line2d_35\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"197.638321\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_32\">\n     <g id=\"line2d_36\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"214.457768\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_33\">\n     <g id=\"line2d_37\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"222.998323\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_34\">\n     <g id=\"line2d_38\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"229.057943\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_35\">\n     <g id=\"line2d_39\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"233.75815\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_36\">\n     <g id=\"line2d_40\">\n      <g>\n       <use xlink:href=\"#m07d6328747\" x=\"237.598498\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_5\">\n     <!-- token: x -->\n     <g transform=\"translate(122.916406 174.076563)scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \nL 1172 3500 \nL 2356 3500 \nL 2356 3053 \nL 1172 3053 \nL 1172 1153 \nQ 1172 725 1289 603 \nQ 1406 481 1766 481 \nL 2356 481 \nL 2356 0 \nL 1766 0 \nQ 1100 0 847 248 \nQ 594 497 594 1153 \nL 594 3053 \nL 172 3053 \nL 172 3500 \nL 594 3500 \nL 594 4494 \nL 1172 4494 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 959 1747 \nQ 959 1119 1226 758 \nQ 1494 397 1959 397 \nQ 2419 397 2687 759 \nQ 2956 1122 2956 1747 \nQ 2956 2369 2687 2733 \nQ 2419 3097 1959 3097 \nz\nM 1959 3584 \nQ 2709 3584 3137 3096 \nQ 3566 2609 3566 1747 \nQ 3566 888 3137 398 \nQ 2709 -91 1959 -91 \nQ 1206 -91 779 398 \nQ 353 888 353 1747 \nQ 353 2609 779 3096 \nQ 1206 3584 1959 3584 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6b\" d=\"M 581 4863 \nL 1159 4863 \nL 1159 1991 \nL 2875 3500 \nL 3609 3500 \nL 1753 1863 \nL 3688 0 \nL 2938 0 \nL 1159 1709 \nL 1159 0 \nL 581 0 \nL 581 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \nL 3597 1613 \nL 953 1613 \nQ 991 1019 1311 708 \nQ 1631 397 2203 397 \nQ 2534 397 2845 478 \nQ 3156 559 3463 722 \nL 3463 178 \nQ 3153 47 2828 -22 \nQ 2503 -91 2169 -91 \nQ 1331 -91 842 396 \nQ 353 884 353 1716 \nQ 353 2575 817 3079 \nQ 1281 3584 2069 3584 \nQ 2775 3584 3186 3129 \nQ 3597 2675 3597 1894 \nz\nM 3022 2063 \nQ 3016 2534 2758 2815 \nQ 2500 3097 2075 3097 \nQ 1594 3097 1305 2825 \nQ 1016 2553 972 2059 \nL 3022 2063 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-3a\" d=\"M 750 794 \nL 1409 794 \nL 1409 0 \nL 750 0 \nL 750 794 \nz\nM 750 3309 \nL 1409 3309 \nL 1409 2516 \nL 750 2516 \nL 750 3309 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-78\" d=\"M 3513 3500 \nL 2247 1797 \nL 3578 0 \nL 2900 0 \nL 1881 1375 \nL 863 0 \nL 184 0 \nL 1544 1831 \nL 300 3500 \nL 978 3500 \nL 1906 2253 \nL 2834 3500 \nL 3513 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-74\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" x=\"39.208984\"/>\n      <use xlink:href=\"#DejaVuSans-6b\" x=\"100.390625\"/>\n      <use xlink:href=\"#DejaVuSans-65\" x=\"154.675781\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" x=\"216.199219\"/>\n      <use xlink:href=\"#DejaVuSans-3a\" x=\"279.578125\"/>\n      <use xlink:href=\"#DejaVuSans-20\" x=\"313.269531\"/>\n      <use xlink:href=\"#DejaVuSans-78\" x=\"345.056641\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_41\">\n      <path d=\"M 45.478125 139.5 \nL 240.778125 139.5 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_42\">\n      <defs>\n       <path id=\"m00f6d56348\" d=\"M 0 0 \nL -3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m00f6d56348\" x=\"45.478125\" y=\"139.5\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- $\\mathdefault{10^{0}}$ -->\n      <g transform=\"translate(20.878125 143.299219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_43\">\n      <path d=\"M 45.478125 101.936282 \nL 240.778125 101.936282 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_44\">\n      <g>\n       <use xlink:href=\"#m00f6d56348\" x=\"45.478125\" y=\"101.936282\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- $\\mathdefault{10^{1}}$ -->\n      <g transform=\"translate(20.878125 105.735501)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(128.203125 38.965625)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_45\">\n      <path d=\"M 45.478125 64.372564 \nL 240.778125 64.372564 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_46\">\n      <g>\n       <use xlink:href=\"#m00f6d56348\" x=\"45.478125\" y=\"64.372564\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- $\\mathdefault{10^{2}}$ -->\n      <g transform=\"translate(20.878125 68.171783)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_47\">\n      <path d=\"M 45.478125 26.808846 \nL 240.778125 26.808846 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_48\">\n      <g>\n       <use xlink:href=\"#m00f6d56348\" x=\"45.478125\" y=\"26.808846\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- $\\mathdefault{10^{3}}$ -->\n      <g transform=\"translate(20.878125 30.608065)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-33\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_49\">\n      <defs>\n       <path id=\"m8ce50f8dfd\" d=\"M 0 0 \nL -2 0 \n\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"145.318694\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_50\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"143.1403\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_51\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"141.218821\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_52\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"128.192194\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_53\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"121.577552\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_10\">\n     <g id=\"line2d_54\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"116.884388\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_11\">\n     <g id=\"line2d_55\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"113.244088\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_12\">\n     <g id=\"line2d_56\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"110.269746\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_13\">\n     <g id=\"line2d_57\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"107.754976\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_14\">\n     <g id=\"line2d_58\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"105.576583\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_15\">\n     <g id=\"line2d_59\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"103.655104\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_16\">\n     <g id=\"line2d_60\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"90.628476\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_17\">\n     <g id=\"line2d_61\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"84.013834\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_18\">\n     <g id=\"line2d_62\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"79.32067\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_19\">\n     <g id=\"line2d_63\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"75.68037\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_20\">\n     <g id=\"line2d_64\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"72.706028\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_21\">\n     <g id=\"line2d_65\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"70.191258\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_22\">\n     <g id=\"line2d_66\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"68.012865\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_23\">\n     <g id=\"line2d_67\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"66.091386\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_24\">\n     <g id=\"line2d_68\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"53.064758\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_25\">\n     <g id=\"line2d_69\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"46.450116\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_26\">\n     <g id=\"line2d_70\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"41.756953\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_27\">\n     <g id=\"line2d_71\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"38.116652\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_28\">\n     <g id=\"line2d_72\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"35.14231\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_29\">\n     <g id=\"line2d_73\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"32.62754\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_30\">\n     <g id=\"line2d_74\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"30.449147\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_31\">\n     <g id=\"line2d_75\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"28.527668\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_32\">\n     <g id=\"line2d_76\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"15.501041\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_33\">\n     <g id=\"line2d_77\">\n      <g>\n       <use xlink:href=\"#m8ce50f8dfd\" x=\"45.478125\" y=\"8.886398\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_10\">\n     <!-- frequency: n(x) -->\n     <g transform=\"translate(14.798438 114.517188)rotate(-90)scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-66\" d=\"M 2375 4863 \nL 2375 4384 \nL 1825 4384 \nQ 1516 4384 1395 4259 \nQ 1275 4134 1275 3809 \nL 1275 3500 \nL 2222 3500 \nL 2222 3053 \nL 1275 3053 \nL 1275 0 \nL 697 0 \nL 697 3053 \nL 147 3053 \nL 147 3500 \nL 697 3500 \nL 697 3744 \nQ 697 4328 969 4595 \nQ 1241 4863 1831 4863 \nL 2375 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \nQ 2534 3019 2420 3045 \nQ 2306 3072 2169 3072 \nQ 1681 3072 1420 2755 \nQ 1159 2438 1159 1844 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1341 3275 1631 3429 \nQ 1922 3584 2338 3584 \nQ 2397 3584 2469 3576 \nQ 2541 3569 2628 3553 \nL 2631 2963 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-71\" d=\"M 947 1747 \nQ 947 1113 1208 752 \nQ 1469 391 1925 391 \nQ 2381 391 2643 752 \nQ 2906 1113 2906 1747 \nQ 2906 2381 2643 2742 \nQ 2381 3103 1925 3103 \nQ 1469 3103 1208 2742 \nQ 947 2381 947 1747 \nz\nM 2906 525 \nQ 2725 213 2448 61 \nQ 2172 -91 1784 -91 \nQ 1150 -91 751 415 \nQ 353 922 353 1747 \nQ 353 2572 751 3078 \nQ 1150 3584 1784 3584 \nQ 2172 3584 2448 3432 \nQ 2725 3281 2906 2969 \nL 2906 3500 \nL 3481 3500 \nL 3481 -1331 \nL 2906 -1331 \nL 2906 525 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-75\" d=\"M 544 1381 \nL 544 3500 \nL 1119 3500 \nL 1119 1403 \nQ 1119 906 1312 657 \nQ 1506 409 1894 409 \nQ 2359 409 2629 706 \nQ 2900 1003 2900 1516 \nL 2900 3500 \nL 3475 3500 \nL 3475 0 \nL 2900 0 \nL 2900 538 \nQ 2691 219 2414 64 \nQ 2138 -91 1772 -91 \nQ 1169 -91 856 284 \nQ 544 659 544 1381 \nz\nM 1991 3584 \nL 1991 3584 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \nL 3122 2828 \nQ 2878 2963 2633 3030 \nQ 2388 3097 2138 3097 \nQ 1578 3097 1268 2742 \nQ 959 2388 959 1747 \nQ 959 1106 1268 751 \nQ 1578 397 2138 397 \nQ 2388 397 2633 464 \nQ 2878 531 3122 666 \nL 3122 134 \nQ 2881 22 2623 -34 \nQ 2366 -91 2075 -91 \nQ 1284 -91 818 406 \nQ 353 903 353 1747 \nQ 353 2603 823 3093 \nQ 1294 3584 2113 3584 \nQ 2378 3584 2631 3529 \nQ 2884 3475 3122 3366 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-79\" d=\"M 2059 -325 \nQ 1816 -950 1584 -1140 \nQ 1353 -1331 966 -1331 \nL 506 -1331 \nL 506 -850 \nL 844 -850 \nQ 1081 -850 1212 -737 \nQ 1344 -625 1503 -206 \nL 1606 56 \nL 191 3500 \nL 800 3500 \nL 1894 763 \nL 2988 3500 \nL 3597 3500 \nL 2059 -325 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-28\" d=\"M 1984 4856 \nQ 1566 4138 1362 3434 \nQ 1159 2731 1159 2009 \nQ 1159 1288 1364 580 \nQ 1569 -128 1984 -844 \nL 1484 -844 \nQ 1016 -109 783 600 \nQ 550 1309 550 2009 \nQ 550 2706 781 3412 \nQ 1013 4119 1484 4856 \nL 1984 4856 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-29\" d=\"M 513 4856 \nL 1013 4856 \nQ 1481 4119 1714 3412 \nQ 1947 2706 1947 2009 \nQ 1947 1309 1714 600 \nQ 1481 -109 1013 -844 \nL 513 -844 \nQ 928 -128 1133 580 \nQ 1338 1288 1338 2009 \nQ 1338 2731 1133 3434 \nQ 928 4138 513 4856 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-66\"/>\n      <use xlink:href=\"#DejaVuSans-72\" x=\"35.205078\"/>\n      <use xlink:href=\"#DejaVuSans-65\" x=\"74.068359\"/>\n      <use xlink:href=\"#DejaVuSans-71\" x=\"135.591797\"/>\n      <use xlink:href=\"#DejaVuSans-75\" x=\"199.068359\"/>\n      <use xlink:href=\"#DejaVuSans-65\" x=\"262.447266\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" x=\"323.970703\"/>\n      <use xlink:href=\"#DejaVuSans-63\" x=\"387.349609\"/>\n      <use xlink:href=\"#DejaVuSans-79\" x=\"442.330078\"/>\n      <use xlink:href=\"#DejaVuSans-3a\" x=\"494.259766\"/>\n      <use xlink:href=\"#DejaVuSans-20\" x=\"527.951172\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" x=\"559.738281\"/>\n      <use xlink:href=\"#DejaVuSans-28\" x=\"623.117188\"/>\n      <use xlink:href=\"#DejaVuSans-78\" x=\"662.130859\"/>\n      <use xlink:href=\"#DejaVuSans-29\" x=\"721.310547\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_78\">\n    <path d=\"M -1 22.937391 \nL 54.355398 22.948175 \nL 68.955573 23.233932 \nL 77.496128 24.458034 \nL 83.555748 30.126092 \nL 88.255954 32.744485 \nL 92.096303 36.502574 \nL 95.343271 36.830949 \nL 98.155923 40.091237 \nL 102.85613 40.3137 \nL 104.863705 43.749961 \nL 106.696478 47.517487 \nL 108.382465 48.168938 \nL 111.396684 51.43591 \nL 112.756098 51.809238 \nL 114.033071 52.741704 \nL 115.237033 53.064758 \nL 116.375883 56.910265 \nL 117.456305 57.541843 \nL 118.484001 59.236831 \nL 119.46388 59.236831 \nL 120.400194 59.598035 \nL 121.296653 60.218404 \nL 122.156511 60.473311 \nL 122.982641 60.995394 \nL 123.777588 61.128568 \nL 125.282771 61.128568 \nL 126.687531 61.672409 \nL 127.356273 62.235006 \nL 128.004435 62.235006 \nL 128.633246 62.378741 \nL 129.243828 62.378741 \nL 129.837208 62.523752 \nL 130.414329 63.421982 \nL 130.976058 63.576615 \nL 131.523195 63.89035 \nL 132.05648 65.381982 \nL 133.084176 65.732828 \nL 133.579813 65.732828 \nL 134.064055 65.911122 \nL 134.537414 66.273664 \nL 136.331144 67.023852 \nL 137.173801 67.023852 \nL 137.582816 67.216916 \nL 137.984039 67.216916 \nL 138.377763 67.610036 \nL 139.143796 68.636395 \nL 139.516613 69.065728 \nL 139.882946 69.284707 \nL 140.597035 69.284707 \nL 141.956448 70.191258 \nL 142.60461 70.191258 \nL 142.921362 70.425992 \nL 143.233421 71.151165 \nL 143.540924 72.171104 \nL 144.437383 72.980215 \nL 144.72792 72.980215 \nL 145.014504 73.542812 \nL 145.576233 73.542812 \nL 145.851578 74.125507 \nL 146.123371 74.42485 \nL 146.3917 74.42485 \nL 147.684351 76.009951 \nL 148.90224 76.009951 \nL 149.13759 76.346328 \nL 149.370339 76.346328 \nL 149.600544 76.689788 \nL 149.828261 76.689788 \nL 150.053543 77.040634 \nL 150.715281 77.040634 \nL 150.93132 77.399192 \nL 151.145165 77.399192 \nL 151.566451 78.140852 \nL 151.979476 78.140852 \nL 152.182991 78.524722 \nL 152.384558 78.524722 \nL 152.781996 79.32067 \nL 153.364437 79.32067 \nL 153.743971 80.157455 \nL 153.931205 80.157455 \nL 154.116788 80.592513 \nL 154.843191 80.592513 \nL 155.020944 81.039492 \nL 155.887881 81.039492 \nL 156.057068 81.499064 \nL 156.720543 81.499064 \nL 156.883197 81.971958 \nL 157.678144 81.971958 \nL 157.833596 82.458971 \nL 158.141099 82.458971 \nL 158.293184 82.960971 \nL 158.890773 82.960971 \nL 159.037558 83.47891 \nL 159.328095 83.47891 \nL 159.471874 84.013834 \nL 159.756522 84.013834 \nL 159.897416 84.566894 \nL 160.037374 84.566894 \nL 160.176408 85.139364 \nL 160.858138 85.139364 \nL 160.991875 85.732655 \nL 161.518493 85.732655 \nL 161.648115 86.34834 \nL 162.409533 86.34834 \nL 162.533803 86.988176 \nL 162.902271 86.988176 \nL 163.023676 87.654134 \nL 163.502415 87.654134 \nL 163.620418 88.34844 \nL 164.200719 88.34844 \nL 164.314886 89.073613 \nL 165.423752 89.073613 \nL 165.638689 89.832527 \nL 166.374151 89.832527 \nL 166.579651 90.628476 \nL 167.675405 90.628476 \nL 167.86865 91.46526 \nL 168.716963 91.46526 \nL 168.900926 92.347298 \nL 169.173892 92.347298 \nL 169.353924 93.279764 \nL 169.972187 93.279764 \nL 170.145551 94.268777 \nL 171.483372 94.268777 \nL 171.64478 95.32164 \nL 172.433771 95.32164 \nL 172.588084 96.44717 \nL 173.490948 96.44717 \nL 173.637733 97.656146 \nL 175.256101 97.656146 \nL 175.391124 98.96194 \nL 176.37712 98.96194 \nL 176.505167 100.381419 \nL 178.33794 100.381419 \nL 178.454636 101.936282 \nL 180.451629 101.936282 \nL 180.609805 103.655104 \nL 182.42068 103.655104 \nL 182.564787 105.576583 \nL 185.257418 105.576583 \nL 185.383422 107.754976 \nL 188.528445 107.754976 \nL 188.672225 110.269746 \nL 191.67211 110.269746 \nL 191.796014 113.244088 \nL 195.754423 113.244088 \nL 195.882004 116.884388 \nL 200.724191 116.884388 \nL 200.84513 121.577552 \nL 207.214001 121.577552 \nL 207.332503 128.192194 \nL 216.282641 128.192194 \nL 216.398216 139.5 \nL 231.900852 139.5 \nL 231.900852 139.5 \n\" clip-path=\"url(#p16ca67a19c)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 45.478125 145.8 \nL 45.478125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 240.778125 145.8 \nL 240.778125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 45.478125 145.8 \nL 240.778125 145.8 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 45.478125 7.2 \nL 240.778125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p16ca67a19c\">\n   <rect x=\"45.478125\" y=\"7.2\" width=\"195.3\" height=\"138.6\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "freqs = [freq for token, freq in vocab.token_freqs]\n",
    "d2l.plot(freqs, xlabel='token: x', ylabel='frequency: n(x)',\n",
    "         xscale='log', yscale='log')"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T15:16:53.698960200Z",
     "start_time": "2023-05-11T15:16:53.122959800Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "data": {
      "text/plain": "[(('of', 'the'), 309),\n (('in', 'the'), 169),\n (('i', 'had'), 130),\n (('i', 'was'), 112),\n (('and', 'the'), 109),\n (('the', 'time'), 102),\n (('it', 'was'), 99),\n (('to', 'the'), 85),\n (('as', 'i'), 78),\n (('of', 'a'), 73)]"
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bigram_tokens = [pair for pair in zip(corpus[:-1], corpus[1:])]\n",
    "bigram_vocab = d2l.Vocab(bigram_tokens)\n",
    "bigram_vocab.token_freqs[:10]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T15:21:23.350365600Z",
     "start_time": "2023-05-11T15:21:23.294369700Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "data": {
      "text/plain": "[(('the', 'time', 'traveller'), 59),\n (('the', 'time', 'machine'), 30),\n (('the', 'medical', 'man'), 24),\n (('it', 'seemed', 'to'), 16),\n (('it', 'was', 'a'), 15),\n (('here', 'and', 'there'), 15),\n (('seemed', 'to', 'me'), 14),\n (('i', 'did', 'not'), 14),\n (('i', 'saw', 'the'), 13),\n (('i', 'began', 'to'), 13)]"
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trigram_tokens = [triple for triple in zip(\n",
    "    corpus[:-2], corpus[1:-1], corpus[2:])]\n",
    "trigram_vocab = d2l.Vocab(trigram_tokens)\n",
    "trigram_vocab.token_freqs[:10]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T15:27:50.283440200Z",
     "start_time": "2023-05-11T15:27:50.224419200Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 350x250 with 1 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"247.978125pt\" height=\"183.35625pt\" viewBox=\"0 0 247.978125 183.35625\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2023-05-11T23:28:06.441822</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 183.35625 \nL 247.978125 183.35625 \nL 247.978125 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 45.478125 145.8 \nL 240.778125 145.8 \nL 240.778125 7.2 \nL 45.478125 7.2 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <path d=\"M 54.355398 145.8 \nL 54.355398 7.2 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_2\">\n      <defs>\n       <path id=\"mc8575e16fe\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#mc8575e16fe\" x=\"54.355398\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- $\\mathdefault{10^{0}}$ -->\n      <g transform=\"translate(45.555398 160.398438)scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_3\">\n      <path d=\"M 94.026857 145.8 \nL 94.026857 7.2 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_4\">\n      <g>\n       <use xlink:href=\"#mc8575e16fe\" x=\"94.026857\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- $\\mathdefault{10^{1}}$ -->\n      <g transform=\"translate(85.226857 160.398438)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(128.203125 38.965625)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_5\">\n      <path d=\"M 133.698316 145.8 \nL 133.698316 7.2 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_6\">\n      <g>\n       <use xlink:href=\"#mc8575e16fe\" x=\"133.698316\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- $\\mathdefault{10^{2}}$ -->\n      <g transform=\"translate(124.898316 160.398438)scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_7\">\n      <path d=\"M 173.369775 145.8 \nL 173.369775 7.2 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_8\">\n      <g>\n       <use xlink:href=\"#mc8575e16fe\" x=\"173.369775\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- $\\mathdefault{10^{3}}$ -->\n      <g transform=\"translate(164.569775 160.398438)scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-33\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_9\">\n      <path d=\"M 213.041234 145.8 \nL 213.041234 7.2 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_10\">\n      <g>\n       <use xlink:href=\"#mc8575e16fe\" x=\"213.041234\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- $\\mathdefault{10^{4}}$ -->\n      <g transform=\"translate(204.241234 160.398438)scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \nL 825 1625 \nL 2419 1625 \nL 2419 4116 \nz\nM 2253 4666 \nL 3047 4666 \nL 3047 1625 \nL 3713 1625 \nL 3713 1100 \nL 3047 1100 \nL 3047 0 \nL 2419 0 \nL 2419 1100 \nL 313 1100 \nL 313 1709 \nL 2253 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-34\" transform=\"translate(128.203125 38.965625)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_11\">\n      <defs>\n       <path id=\"m6dff14d529\" d=\"M 0 0 \nL 0 2 \n\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"45.554334\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_7\">\n     <g id=\"line2d_12\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"48.210211\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_8\">\n     <g id=\"line2d_13\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"50.510836\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_9\">\n     <g id=\"line2d_14\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"52.540131\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_10\">\n     <g id=\"line2d_15\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"66.297697\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_11\">\n     <g id=\"line2d_16\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"73.283494\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_12\">\n     <g id=\"line2d_17\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"78.239996\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_13\">\n     <g id=\"line2d_18\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"82.084558\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_14\">\n     <g id=\"line2d_19\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"85.225793\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_15\">\n     <g id=\"line2d_20\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"87.88167\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_16\">\n     <g id=\"line2d_21\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"90.182295\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_17\">\n     <g id=\"line2d_22\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"92.21159\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_18\">\n     <g id=\"line2d_23\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"105.969156\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_19\">\n     <g id=\"line2d_24\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"112.954953\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_20\">\n     <g id=\"line2d_25\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"117.911455\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_21\">\n     <g id=\"line2d_26\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"121.756017\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_22\">\n     <g id=\"line2d_27\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"124.897252\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_23\">\n     <g id=\"line2d_28\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"127.553129\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_24\">\n     <g id=\"line2d_29\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"129.853754\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_25\">\n     <g id=\"line2d_30\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"131.883049\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_26\">\n     <g id=\"line2d_31\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"145.640615\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_27\">\n     <g id=\"line2d_32\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"152.626412\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_28\">\n     <g id=\"line2d_33\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"157.582914\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_29\">\n     <g id=\"line2d_34\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"161.427476\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_30\">\n     <g id=\"line2d_35\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"164.568711\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_31\">\n     <g id=\"line2d_36\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"167.224588\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_32\">\n     <g id=\"line2d_37\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"169.525213\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_33\">\n     <g id=\"line2d_38\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"171.554508\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_34\">\n     <g id=\"line2d_39\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"185.312074\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_35\">\n     <g id=\"line2d_40\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"192.297871\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_36\">\n     <g id=\"line2d_41\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"197.254373\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_37\">\n     <g id=\"line2d_42\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"201.098935\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_38\">\n     <g id=\"line2d_43\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"204.24017\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_39\">\n     <g id=\"line2d_44\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"206.896047\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_40\">\n     <g id=\"line2d_45\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"209.196672\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_41\">\n     <g id=\"line2d_46\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"211.225968\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_42\">\n     <g id=\"line2d_47\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"224.983533\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_43\">\n     <g id=\"line2d_48\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"231.96933\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_44\">\n     <g id=\"line2d_49\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"236.925832\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_45\">\n     <g id=\"line2d_50\">\n      <g>\n       <use xlink:href=\"#m6dff14d529\" x=\"240.770394\" y=\"145.8\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_6\">\n     <!-- token: x -->\n     <g transform=\"translate(122.916406 174.076563)scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \nL 1172 3500 \nL 2356 3500 \nL 2356 3053 \nL 1172 3053 \nL 1172 1153 \nQ 1172 725 1289 603 \nQ 1406 481 1766 481 \nL 2356 481 \nL 2356 0 \nL 1766 0 \nQ 1100 0 847 248 \nQ 594 497 594 1153 \nL 594 3053 \nL 172 3053 \nL 172 3500 \nL 594 3500 \nL 594 4494 \nL 1172 4494 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \nQ 1497 3097 1228 2736 \nQ 959 2375 959 1747 \nQ 959 1119 1226 758 \nQ 1494 397 1959 397 \nQ 2419 397 2687 759 \nQ 2956 1122 2956 1747 \nQ 2956 2369 2687 2733 \nQ 2419 3097 1959 3097 \nz\nM 1959 3584 \nQ 2709 3584 3137 3096 \nQ 3566 2609 3566 1747 \nQ 3566 888 3137 398 \nQ 2709 -91 1959 -91 \nQ 1206 -91 779 398 \nQ 353 888 353 1747 \nQ 353 2609 779 3096 \nQ 1206 3584 1959 3584 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6b\" d=\"M 581 4863 \nL 1159 4863 \nL 1159 1991 \nL 2875 3500 \nL 3609 3500 \nL 1753 1863 \nL 3688 0 \nL 2938 0 \nL 1159 1709 \nL 1159 0 \nL 581 0 \nL 581 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \nL 3597 1613 \nL 953 1613 \nQ 991 1019 1311 708 \nQ 1631 397 2203 397 \nQ 2534 397 2845 478 \nQ 3156 559 3463 722 \nL 3463 178 \nQ 3153 47 2828 -22 \nQ 2503 -91 2169 -91 \nQ 1331 -91 842 396 \nQ 353 884 353 1716 \nQ 353 2575 817 3079 \nQ 1281 3584 2069 3584 \nQ 2775 3584 3186 3129 \nQ 3597 2675 3597 1894 \nz\nM 3022 2063 \nQ 3016 2534 2758 2815 \nQ 2500 3097 2075 3097 \nQ 1594 3097 1305 2825 \nQ 1016 2553 972 2059 \nL 3022 2063 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \nL 3513 0 \nL 2938 0 \nL 2938 2094 \nQ 2938 2591 2744 2837 \nQ 2550 3084 2163 3084 \nQ 1697 3084 1428 2787 \nQ 1159 2491 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1366 3272 1645 3428 \nQ 1925 3584 2291 3584 \nQ 2894 3584 3203 3211 \nQ 3513 2838 3513 2113 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-3a\" d=\"M 750 794 \nL 1409 794 \nL 1409 0 \nL 750 0 \nL 750 794 \nz\nM 750 3309 \nL 1409 3309 \nL 1409 2516 \nL 750 2516 \nL 750 3309 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-78\" d=\"M 3513 3500 \nL 2247 1797 \nL 3578 0 \nL 2900 0 \nL 1881 1375 \nL 863 0 \nL 184 0 \nL 1544 1831 \nL 300 3500 \nL 978 3500 \nL 1906 2253 \nL 2834 3500 \nL 3513 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-74\"/>\n      <use xlink:href=\"#DejaVuSans-6f\" x=\"39.208984\"/>\n      <use xlink:href=\"#DejaVuSans-6b\" x=\"100.390625\"/>\n      <use xlink:href=\"#DejaVuSans-65\" x=\"154.675781\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" x=\"216.199219\"/>\n      <use xlink:href=\"#DejaVuSans-3a\" x=\"279.578125\"/>\n      <use xlink:href=\"#DejaVuSans-20\" x=\"313.269531\"/>\n      <use xlink:href=\"#DejaVuSans-78\" x=\"345.056641\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_51\">\n      <path d=\"M 45.478125 139.5 \nL 240.778125 139.5 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_52\">\n      <defs>\n       <path id=\"md7780c410d\" d=\"M 0 0 \nL -3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#md7780c410d\" x=\"45.478125\" y=\"139.5\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- $\\mathdefault{10^{0}}$ -->\n      <g transform=\"translate(20.878125 143.299219)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_53\">\n      <path d=\"M 45.478125 101.936282 \nL 240.778125 101.936282 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_54\">\n      <g>\n       <use xlink:href=\"#md7780c410d\" x=\"45.478125\" y=\"101.936282\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- $\\mathdefault{10^{1}}$ -->\n      <g transform=\"translate(20.878125 105.735501)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.684375)\"/>\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(128.203125 38.965625)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_55\">\n      <path d=\"M 45.478125 64.372564 \nL 240.778125 64.372564 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_56\">\n      <g>\n       <use xlink:href=\"#md7780c410d\" x=\"45.478125\" y=\"64.372564\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- $\\mathdefault{10^{2}}$ -->\n      <g transform=\"translate(20.878125 68.171783)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_57\">\n      <path d=\"M 45.478125 26.808846 \nL 240.778125 26.808846 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square\"/>\n     </g>\n     <g id=\"line2d_58\">\n      <g>\n       <use xlink:href=\"#md7780c410d\" x=\"45.478125\" y=\"26.808846\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- $\\mathdefault{10^{3}}$ -->\n      <g transform=\"translate(20.878125 30.608065)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(0 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0.765625)\"/>\n       <use xlink:href=\"#DejaVuSans-33\" transform=\"translate(128.203125 39.046875)scale(0.7)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_59\">\n      <defs>\n       <path id=\"m8668e918ec\" d=\"M 0 0 \nL -2 0 \n\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"145.318694\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_60\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"143.1403\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_61\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"141.218821\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_62\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"128.192194\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_63\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"121.577552\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_10\">\n     <g id=\"line2d_64\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"116.884388\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_11\">\n     <g id=\"line2d_65\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"113.244088\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_12\">\n     <g id=\"line2d_66\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"110.269746\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_13\">\n     <g id=\"line2d_67\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"107.754976\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_14\">\n     <g id=\"line2d_68\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"105.576583\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_15\">\n     <g id=\"line2d_69\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"103.655104\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_16\">\n     <g id=\"line2d_70\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"90.628476\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_17\">\n     <g id=\"line2d_71\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"84.013834\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_18\">\n     <g id=\"line2d_72\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"79.32067\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_19\">\n     <g id=\"line2d_73\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"75.68037\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_20\">\n     <g id=\"line2d_74\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"72.706028\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_21\">\n     <g id=\"line2d_75\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"70.191258\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_22\">\n     <g id=\"line2d_76\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"68.012865\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_23\">\n     <g id=\"line2d_77\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"66.091386\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_24\">\n     <g id=\"line2d_78\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"53.064758\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_25\">\n     <g id=\"line2d_79\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"46.450116\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_26\">\n     <g id=\"line2d_80\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"41.756953\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_27\">\n     <g id=\"line2d_81\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"38.116652\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_28\">\n     <g id=\"line2d_82\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"35.14231\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_29\">\n     <g id=\"line2d_83\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"32.62754\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_30\">\n     <g id=\"line2d_84\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"30.449147\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_31\">\n     <g id=\"line2d_85\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"28.527668\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_32\">\n     <g id=\"line2d_86\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"15.501041\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_33\">\n     <g id=\"line2d_87\">\n      <g>\n       <use xlink:href=\"#m8668e918ec\" x=\"45.478125\" y=\"8.886398\" style=\"stroke: #000000; stroke-width: 0.6\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_11\">\n     <!-- frequency: n(x) -->\n     <g transform=\"translate(14.798438 114.517188)rotate(-90)scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-66\" d=\"M 2375 4863 \nL 2375 4384 \nL 1825 4384 \nQ 1516 4384 1395 4259 \nQ 1275 4134 1275 3809 \nL 1275 3500 \nL 2222 3500 \nL 2222 3053 \nL 1275 3053 \nL 1275 0 \nL 697 0 \nL 697 3053 \nL 147 3053 \nL 147 3500 \nL 697 3500 \nL 697 3744 \nQ 697 4328 969 4595 \nQ 1241 4863 1831 4863 \nL 2375 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \nQ 2534 3019 2420 3045 \nQ 2306 3072 2169 3072 \nQ 1681 3072 1420 2755 \nQ 1159 2438 1159 1844 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1341 3275 1631 3429 \nQ 1922 3584 2338 3584 \nQ 2397 3584 2469 3576 \nQ 2541 3569 2628 3553 \nL 2631 2963 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-71\" d=\"M 947 1747 \nQ 947 1113 1208 752 \nQ 1469 391 1925 391 \nQ 2381 391 2643 752 \nQ 2906 1113 2906 1747 \nQ 2906 2381 2643 2742 \nQ 2381 3103 1925 3103 \nQ 1469 3103 1208 2742 \nQ 947 2381 947 1747 \nz\nM 2906 525 \nQ 2725 213 2448 61 \nQ 2172 -91 1784 -91 \nQ 1150 -91 751 415 \nQ 353 922 353 1747 \nQ 353 2572 751 3078 \nQ 1150 3584 1784 3584 \nQ 2172 3584 2448 3432 \nQ 2725 3281 2906 2969 \nL 2906 3500 \nL 3481 3500 \nL 3481 -1331 \nL 2906 -1331 \nL 2906 525 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-75\" d=\"M 544 1381 \nL 544 3500 \nL 1119 3500 \nL 1119 1403 \nQ 1119 906 1312 657 \nQ 1506 409 1894 409 \nQ 2359 409 2629 706 \nQ 2900 1003 2900 1516 \nL 2900 3500 \nL 3475 3500 \nL 3475 0 \nL 2900 0 \nL 2900 538 \nQ 2691 219 2414 64 \nQ 2138 -91 1772 -91 \nQ 1169 -91 856 284 \nQ 544 659 544 1381 \nz\nM 1991 3584 \nL 1991 3584 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \nL 3122 2828 \nQ 2878 2963 2633 3030 \nQ 2388 3097 2138 3097 \nQ 1578 3097 1268 2742 \nQ 959 2388 959 1747 \nQ 959 1106 1268 751 \nQ 1578 397 2138 397 \nQ 2388 397 2633 464 \nQ 2878 531 3122 666 \nL 3122 134 \nQ 2881 22 2623 -34 \nQ 2366 -91 2075 -91 \nQ 1284 -91 818 406 \nQ 353 903 353 1747 \nQ 353 2603 823 3093 \nQ 1294 3584 2113 3584 \nQ 2378 3584 2631 3529 \nQ 2884 3475 3122 3366 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-79\" d=\"M 2059 -325 \nQ 1816 -950 1584 -1140 \nQ 1353 -1331 966 -1331 \nL 506 -1331 \nL 506 -850 \nL 844 -850 \nQ 1081 -850 1212 -737 \nQ 1344 -625 1503 -206 \nL 1606 56 \nL 191 3500 \nL 800 3500 \nL 1894 763 \nL 2988 3500 \nL 3597 3500 \nL 2059 -325 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-28\" d=\"M 1984 4856 \nQ 1566 4138 1362 3434 \nQ 1159 2731 1159 2009 \nQ 1159 1288 1364 580 \nQ 1569 -128 1984 -844 \nL 1484 -844 \nQ 1016 -109 783 600 \nQ 550 1309 550 2009 \nQ 550 2706 781 3412 \nQ 1013 4119 1484 4856 \nL 1984 4856 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-29\" d=\"M 513 4856 \nL 1013 4856 \nQ 1481 4119 1714 3412 \nQ 1947 2706 1947 2009 \nQ 1947 1309 1714 600 \nQ 1481 -109 1013 -844 \nL 513 -844 \nQ 928 -128 1133 580 \nQ 1338 1288 1338 2009 \nQ 1338 2731 1133 3434 \nQ 928 4138 513 4856 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-66\"/>\n      <use xlink:href=\"#DejaVuSans-72\" x=\"35.205078\"/>\n      <use xlink:href=\"#DejaVuSans-65\" x=\"74.068359\"/>\n      <use xlink:href=\"#DejaVuSans-71\" x=\"135.591797\"/>\n      <use xlink:href=\"#DejaVuSans-75\" x=\"199.068359\"/>\n      <use xlink:href=\"#DejaVuSans-65\" x=\"262.447266\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" x=\"323.970703\"/>\n      <use xlink:href=\"#DejaVuSans-63\" x=\"387.349609\"/>\n      <use xlink:href=\"#DejaVuSans-79\" x=\"442.330078\"/>\n      <use xlink:href=\"#DejaVuSans-3a\" x=\"494.259766\"/>\n      <use xlink:href=\"#DejaVuSans-20\" x=\"527.951172\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" x=\"559.738281\"/>\n      <use xlink:href=\"#DejaVuSans-28\" x=\"623.117188\"/>\n      <use xlink:href=\"#DejaVuSans-78\" x=\"662.130859\"/>\n      <use xlink:href=\"#DejaVuSans-29\" x=\"721.310547\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_88\">\n    <path d=\"M -1 22.934991 \nL 54.355398 22.948175 \nL 66.297697 23.233932 \nL 73.283494 24.458034 \nL 78.239996 30.126092 \nL 82.084558 32.744485 \nL 85.225793 36.502574 \nL 87.88167 36.830949 \nL 90.182295 40.091237 \nL 94.026857 40.3137 \nL 95.668965 43.749961 \nL 97.168092 47.517487 \nL 98.547156 48.168938 \nL 101.012654 51.43591 \nL 102.124594 51.809238 \nL 103.169102 52.741704 \nL 104.15389 53.064758 \nL 105.085419 56.910265 \nL 105.969156 57.541843 \nL 106.809766 59.236831 \nL 107.611264 59.236831 \nL 108.377128 59.598035 \nL 109.110391 60.218404 \nL 109.813718 60.473311 \nL 110.489455 60.995394 \nL 111.139687 61.128568 \nL 112.37086 61.128568 \nL 113.519892 61.672409 \nL 114.066893 62.235006 \nL 114.597061 62.235006 \nL 115.111401 62.378741 \nL 115.61083 62.378741 \nL 116.096189 62.523752 \nL 116.568248 63.421982 \nL 117.027718 63.576615 \nL 117.475252 63.89035 \nL 117.911455 65.381982 \nL 118.752065 65.732828 \nL 119.157475 65.732828 \nL 119.553563 65.911122 \nL 119.94075 66.273664 \nL 121.407942 67.023852 \nL 122.097198 67.023852 \nL 122.431754 67.216916 \nL 122.759937 67.216916 \nL 123.081986 67.610036 \nL 123.708567 68.636395 \nL 124.013515 69.065728 \nL 124.313159 69.284707 \nL 124.897252 69.284707 \nL 126.009193 70.191258 \nL 126.53936 70.191258 \nL 126.798449 70.425992 \nL 127.553129 72.436374 \nL 128.038488 72.980215 \nL 128.276134 72.980215 \nL 128.510547 73.542812 \nL 128.970017 73.542812 \nL 129.417551 74.42485 \nL 129.637033 74.42485 \nL 130.898262 76.009951 \nL 131.690544 76.009951 \nL 131.883049 76.346328 \nL 132.073428 76.346328 \nL 132.261726 76.689788 \nL 132.447988 76.689788 \nL 132.632259 77.040634 \nL 133.173531 77.040634 \nL 133.350241 77.399192 \nL 133.525158 77.399192 \nL 133.869751 78.140852 \nL 134.207587 78.140852 \nL 134.374053 78.524722 \nL 134.538926 78.524722 \nL 134.864013 79.32067 \nL 135.340424 79.32067 \nL 135.650867 80.157455 \nL 135.804015 80.157455 \nL 135.955814 80.592513 \nL 136.54998 80.592513 \nL 136.695374 81.039492 \nL 137.40449 81.039492 \nL 137.542877 81.499064 \nL 138.085571 81.499064 \nL 138.218615 81.971958 \nL 138.868847 81.971958 \nL 138.995999 82.458971 \nL 139.247523 82.458971 \nL 139.371922 82.960971 \nL 139.860723 82.960971 \nL 139.980787 83.47891 \nL 140.218433 83.47891 \nL 140.336039 84.013834 \nL 140.568868 84.013834 \nL 140.684113 84.566894 \nL 140.798592 84.566894 \nL 141.025294 85.139364 \nL 141.469941 85.139364 \nL 141.688034 85.732655 \nL 142.010082 85.732655 \nL 142.221485 86.34834 \nL 142.738914 86.34834 \nL 142.941611 86.988176 \nL 143.141952 86.988176 \nL 143.33999 87.654134 \nL 143.632843 87.654134 \nL 143.825349 88.34844 \nL 144.204025 88.34844 \nL 144.390288 89.073613 \nL 145.204412 89.073613 \nL 145.380221 89.832527 \nL 145.981796 89.832527 \nL 146.149886 90.628476 \nL 147.046164 90.628476 \nL 147.204231 91.46526 \nL 147.898113 91.46526 \nL 148.048587 92.347298 \nL 148.271861 92.347298 \nL 148.419119 93.279764 \nL 148.924831 93.279764 \nL 149.066635 94.268777 \nL 150.160914 94.268777 \nL 150.292938 95.32164 \nL 150.938298 95.32164 \nL 151.064519 96.44717 \nL 151.803022 96.44717 \nL 151.923086 97.656146 \nL 153.246839 97.656146 \nL 153.41224 98.96194 \nL 154.163784 98.96194 \nL 154.320651 100.381419 \nL 155.767648 100.381419 \nL 155.910629 101.936282 \nL 157.496553 101.936282 \nL 157.625933 103.655104 \nL 159.107149 103.655104 \nL 159.225022 105.576583 \nL 161.427476 105.576583 \nL 161.56476 107.754976 \nL 164.103032 107.754976 \nL 164.220637 110.269746 \nL 166.674411 110.269746 \nL 166.801003 113.244088 \nL 170.013563 113.244088 \nL 170.138714 116.884388 \nL 174.078613 116.884388 \nL 174.193969 121.577552 \nL 179.386992 121.577552 \nL 179.508069 128.192194 \nL 186.804739 128.192194 \nL 186.922828 139.5 \nL 199.579747 139.5 \nL 199.579747 139.5 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"line2d_89\">\n    <path d=\"M -1 55.798556 \nL 54.355398 55.812292 \nL 73.283494 62.523752 \nL 78.239996 62.966686 \nL 82.084558 64.04951 \nL 85.225793 64.536523 \nL 87.88167 67.023852 \nL 90.182295 68.425892 \nL 92.21159 69.506666 \nL 94.026857 70.664152 \nL 95.668965 70.905841 \nL 97.168092 72.171104 \nL 98.547156 72.436374 \nL 99.823969 72.436374 \nL 101.012654 72.706028 \nL 102.124594 75.357316 \nL 103.169102 75.357316 \nL 104.15389 76.009951 \nL 105.085419 76.009951 \nL 105.969156 76.689788 \nL 106.809766 76.689788 \nL 108.377128 77.399192 \nL 109.813718 77.399192 \nL 110.489455 77.765807 \nL 111.139687 77.765807 \nL 111.766268 78.917842 \nL 112.37086 79.32067 \nL 112.954953 79.32067 \nL 113.519892 79.733698 \nL 115.111401 79.733698 \nL 115.61083 80.592513 \nL 116.096189 81.039492 \nL 117.027718 81.039492 \nL 117.475252 81.971958 \nL 118.336886 81.971958 \nL 118.752065 82.960971 \nL 119.157475 82.960971 \nL 119.94075 84.013834 \nL 121.052691 84.013834 \nL 121.756017 85.139364 \nL 122.431754 85.139364 \nL 122.759937 85.732655 \nL 123.708567 85.732655 \nL 124.013515 86.34834 \nL 124.607681 86.34834 \nL 124.897252 86.988176 \nL 125.462191 86.988176 \nL 125.737863 87.654134 \nL 126.53936 87.654134 \nL 126.798449 88.34844 \nL 127.553129 88.34844 \nL 127.797518 89.073613 \nL 129.637033 89.073613 \nL 129.853754 89.832527 \nL 130.898262 89.832527 \nL 131.099774 90.628476 \nL 131.495862 90.628476 \nL 131.690544 91.46526 \nL 133.173531 91.46526 \nL 133.350241 92.347298 \nL 134.538926 92.347298 \nL 134.702236 93.279764 \nL 135.18308 93.279764 \nL 135.340424 94.268777 \nL 137.542877 94.268777 \nL 137.680162 95.32164 \nL 139.980787 95.32164 \nL 140.10002 96.44717 \nL 141.796053 96.44717 \nL 142.010082 97.656146 \nL 143.535777 97.656146 \nL 143.729364 98.96194 \nL 145.292541 98.96194 \nL 145.467457 100.381419 \nL 147.438644 100.381419 \nL 147.593166 101.936282 \nL 150.489097 101.936282 \nL 150.61864 103.655104 \nL 152.854615 103.655104 \nL 152.967594 105.576583 \nL 156.099442 105.576583 \nL 156.239707 107.754976 \nL 159.458377 107.754976 \nL 159.57388 110.269746 \nL 163.225504 110.269746 \nL 163.349233 113.244088 \nL 167.82918 113.244088 \nL 167.947593 116.884388 \nL 174.128146 116.884388 \nL 174.243171 121.577552 \nL 182.205262 121.577552 \nL 182.318375 128.192194 \nL 195.477351 128.192194 \nL 195.591578 139.5 \nL 225.183092 139.5 \nL 225.183092 139.5 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #bf00bf; stroke-width: 1.5\"/>\n   </g>\n   <g id=\"line2d_90\">\n    <path d=\"M -1 83.998438 \nL 54.355398 84.013834 \nL 66.297697 87.654134 \nL 73.283494 94.268777 \nL 78.239996 95.32164 \nL 82.084558 95.32164 \nL 85.225793 96.44717 \nL 87.88167 96.44717 \nL 90.182295 97.656146 \nL 92.21159 97.656146 \nL 94.026857 98.96194 \nL 98.547156 98.96194 \nL 99.823969 100.381419 \nL 105.969156 100.381419 \nL 106.809766 101.936282 \nL 109.813718 101.936282 \nL 110.489455 103.655104 \nL 114.066893 103.655104 \nL 114.597061 105.576583 \nL 121.052691 105.576583 \nL 121.407942 107.754976 \nL 126.276316 107.754976 \nL 126.53936 110.269746 \nL 132.632259 110.269746 \nL 132.814579 113.244088 \nL 140.568868 113.244088 \nL 140.684113 116.884388 \nL 148.271861 116.884388 \nL 148.419119 121.577552 \nL 160.652212 121.577552 \nL 160.795788 128.192194 \nL 181.787567 128.192194 \nL 181.903446 139.5 \nL 231.900852 139.5 \nL 231.900852 139.5 \n\" clip-path=\"url(#p83c47c2a3a)\" style=\"fill: none; stroke-dasharray: 9.6,2.4,1.5,2.4; stroke-dashoffset: 0; stroke: #008000; stroke-width: 1.5\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 45.478125 145.8 \nL 45.478125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 240.778125 145.8 \nL 240.778125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 45.478125 145.8 \nL 240.778125 145.8 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 45.478125 7.2 \nL 240.778125 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"legend_1\">\n    <g id=\"patch_7\">\n     <path d=\"M 159.996875 59.234375 \nL 233.778125 59.234375 \nQ 235.778125 59.234375 235.778125 57.234375 \nL 235.778125 14.2 \nQ 235.778125 12.2 233.778125 12.2 \nL 159.996875 12.2 \nQ 157.996875 12.2 157.996875 14.2 \nL 157.996875 57.234375 \nQ 157.996875 59.234375 159.996875 59.234375 \nz\n\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n    </g>\n    <g id=\"line2d_91\">\n     <path d=\"M 161.996875 20.298438 \nL 171.996875 20.298438 \nL 181.996875 20.298438 \n\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n    </g>\n    <g id=\"text_12\">\n     <!-- unigram -->\n     <g transform=\"translate(189.996875 23.798438)scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \nL 1178 3500 \nL 1178 0 \nL 603 0 \nL 603 3500 \nz\nM 603 4863 \nL 1178 4863 \nL 1178 4134 \nL 603 4134 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-67\" d=\"M 2906 1791 \nQ 2906 2416 2648 2759 \nQ 2391 3103 1925 3103 \nQ 1463 3103 1205 2759 \nQ 947 2416 947 1791 \nQ 947 1169 1205 825 \nQ 1463 481 1925 481 \nQ 2391 481 2648 825 \nQ 2906 1169 2906 1791 \nz\nM 3481 434 \nQ 3481 -459 3084 -895 \nQ 2688 -1331 1869 -1331 \nQ 1566 -1331 1297 -1286 \nQ 1028 -1241 775 -1147 \nL 775 -588 \nQ 1028 -725 1275 -790 \nQ 1522 -856 1778 -856 \nQ 2344 -856 2625 -561 \nQ 2906 -266 2906 331 \nL 2906 616 \nQ 2728 306 2450 153 \nQ 2172 0 1784 0 \nQ 1141 0 747 490 \nQ 353 981 353 1791 \nQ 353 2603 747 3093 \nQ 1141 3584 1784 3584 \nQ 2172 3584 2450 3431 \nQ 2728 3278 2906 2969 \nL 2906 3500 \nL 3481 3500 \nL 3481 434 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \nQ 1497 1759 1228 1600 \nQ 959 1441 959 1056 \nQ 959 750 1161 570 \nQ 1363 391 1709 391 \nQ 2188 391 2477 730 \nQ 2766 1069 2766 1631 \nL 2766 1759 \nL 2194 1759 \nz\nM 3341 1997 \nL 3341 0 \nL 2766 0 \nL 2766 531 \nQ 2569 213 2275 61 \nQ 1981 -91 1556 -91 \nQ 1019 -91 701 211 \nQ 384 513 384 1019 \nQ 384 1609 779 1909 \nQ 1175 2209 1959 2209 \nL 2766 2209 \nL 2766 2266 \nQ 2766 2663 2505 2880 \nQ 2244 3097 1772 3097 \nQ 1472 3097 1187 3025 \nQ 903 2953 641 2809 \nL 641 3341 \nQ 956 3463 1253 3523 \nQ 1550 3584 1831 3584 \nQ 2591 3584 2966 3190 \nQ 3341 2797 3341 1997 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-6d\" d=\"M 3328 2828 \nQ 3544 3216 3844 3400 \nQ 4144 3584 4550 3584 \nQ 5097 3584 5394 3201 \nQ 5691 2819 5691 2113 \nL 5691 0 \nL 5113 0 \nL 5113 2094 \nQ 5113 2597 4934 2840 \nQ 4756 3084 4391 3084 \nQ 3944 3084 3684 2787 \nQ 3425 2491 3425 1978 \nL 3425 0 \nL 2847 0 \nL 2847 2094 \nQ 2847 2600 2669 2842 \nQ 2491 3084 2119 3084 \nQ 1678 3084 1418 2786 \nQ 1159 2488 1159 1978 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1356 3278 1631 3431 \nQ 1906 3584 2284 3584 \nQ 2666 3584 2933 3390 \nQ 3200 3197 3328 2828 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-75\"/>\n      <use xlink:href=\"#DejaVuSans-6e\" x=\"63.378906\"/>\n      <use xlink:href=\"#DejaVuSans-69\" x=\"126.757812\"/>\n      <use xlink:href=\"#DejaVuSans-67\" x=\"154.541016\"/>\n      <use xlink:href=\"#DejaVuSans-72\" x=\"218.017578\"/>\n      <use xlink:href=\"#DejaVuSans-61\" x=\"259.130859\"/>\n      <use xlink:href=\"#DejaVuSans-6d\" x=\"320.410156\"/>\n     </g>\n    </g>\n    <g id=\"line2d_92\">\n     <path d=\"M 161.996875 34.976563 \nL 171.996875 34.976563 \nL 181.996875 34.976563 \n\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #bf00bf; stroke-width: 1.5\"/>\n    </g>\n    <g id=\"text_13\">\n     <!-- bigram -->\n     <g transform=\"translate(189.996875 38.476563)scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-62\" d=\"M 3116 1747 \nQ 3116 2381 2855 2742 \nQ 2594 3103 2138 3103 \nQ 1681 3103 1420 2742 \nQ 1159 2381 1159 1747 \nQ 1159 1113 1420 752 \nQ 1681 391 2138 391 \nQ 2594 391 2855 752 \nQ 3116 1113 3116 1747 \nz\nM 1159 2969 \nQ 1341 3281 1617 3432 \nQ 1894 3584 2278 3584 \nQ 2916 3584 3314 3078 \nQ 3713 2572 3713 1747 \nQ 3713 922 3314 415 \nQ 2916 -91 2278 -91 \nQ 1894 -91 1617 61 \nQ 1341 213 1159 525 \nL 1159 0 \nL 581 0 \nL 581 4863 \nL 1159 4863 \nL 1159 2969 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-62\"/>\n      <use xlink:href=\"#DejaVuSans-69\" x=\"63.476562\"/>\n      <use xlink:href=\"#DejaVuSans-67\" x=\"91.259766\"/>\n      <use xlink:href=\"#DejaVuSans-72\" x=\"154.736328\"/>\n      <use xlink:href=\"#DejaVuSans-61\" x=\"195.849609\"/>\n      <use xlink:href=\"#DejaVuSans-6d\" x=\"257.128906\"/>\n     </g>\n    </g>\n    <g id=\"line2d_93\">\n     <path d=\"M 161.996875 49.654688 \nL 171.996875 49.654688 \nL 181.996875 49.654688 \n\" style=\"fill: none; stroke-dasharray: 9.6,2.4,1.5,2.4; stroke-dashoffset: 0; stroke: #008000; stroke-width: 1.5\"/>\n    </g>\n    <g id=\"text_14\">\n     <!-- trigram -->\n     <g transform=\"translate(189.996875 53.154688)scale(0.1 -0.1)\">\n      <use xlink:href=\"#DejaVuSans-74\"/>\n      <use xlink:href=\"#DejaVuSans-72\" x=\"39.208984\"/>\n      <use xlink:href=\"#DejaVuSans-69\" x=\"80.322266\"/>\n      <use xlink:href=\"#DejaVuSans-67\" x=\"108.105469\"/>\n      <use xlink:href=\"#DejaVuSans-72\" x=\"171.582031\"/>\n      <use xlink:href=\"#DejaVuSans-61\" x=\"212.695312\"/>\n      <use xlink:href=\"#DejaVuSans-6d\" x=\"273.974609\"/>\n     </g>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p83c47c2a3a\">\n   <rect x=\"45.478125\" y=\"7.2\" width=\"195.3\" height=\"138.6\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "bigram_freqs = [freq for token, freq in bigram_vocab.token_freqs]\n",
    "trigram_freqs = [freq for token, freq in trigram_vocab.token_freqs]\n",
    "d2l.plot([freqs, bigram_freqs, trigram_freqs], xlabel='token: x',\n",
    "         ylabel='frequency: n(x)', xscale='log', yscale='log',\n",
    "         legend=['unigram', 'bigram', 'trigram'])"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T15:28:06.575824200Z",
     "start_time": "2023-05-11T15:28:06.153824200Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [],
   "source": [
    "def seq_data_iter_random(corpus, batch_size, num_steps):  #@save\n",
    "    \"\"\"使⽤随机抽样⽣成⼀个⼩批量⼦序列\"\"\"\n",
    "    # 从随机偏移量开始对序列进⾏分区，随机范围包括num_steps-1\n",
    "    corpus = corpus[random.randint(0, num_steps - 1):]\n",
    "    # 减去1，是因为我们需要考虑标签\n",
    "    num_subseqs = (len(corpus) - 1) // num_steps\n",
    "    # ⻓度为num_steps的⼦序列的起始索引\n",
    "    initial_indices = list(range(0, num_subseqs * num_steps, num_steps))\n",
    "    # 在随机抽样的迭代过程中，\n",
    "    # 来⾃两个相邻的、随机的、⼩批量中的⼦序列不⼀定在原始序列上相邻\n",
    "    random.shuffle(initial_indices)\n",
    "\n",
    "    def data(pos):\n",
    "        # 返回从pos位置开始的⻓度为num_steps的序列\n",
    "        return corpus[pos: pos + num_steps]\n",
    "\n",
    "    num_batches = num_subseqs // batch_size\n",
    "    for i in range(0, batch_size * num_batches, batch_size):\n",
    "        # 在这⾥，initial_indices包含⼦序列的随机起始索引\n",
    "        initial_indices_per_batch = initial_indices[i: i + batch_size]\n",
    "        X = [data(j) for j in initial_indices_per_batch]\n",
    "        Y = [data(j + 1) for j in initial_indices_per_batch]\n",
    "        yield torch.tensor(X), torch.tensor(Y)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T16:11:21.404953800Z",
     "start_time": "2023-05-11T16:11:21.398953800Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X:  tensor([[26, 27, 28, 29, 30],\n",
      "        [ 6,  7,  8,  9, 10]]) \n",
      "Y: tensor([[27, 28, 29, 30, 31],\n",
      "        [ 7,  8,  9, 10, 11]])\n",
      "X:  tensor([[11, 12, 13, 14, 15],\n",
      "        [21, 22, 23, 24, 25]]) \n",
      "Y: tensor([[12, 13, 14, 15, 16],\n",
      "        [22, 23, 24, 25, 26]])\n",
      "X:  tensor([[16, 17, 18, 19, 20],\n",
      "        [ 1,  2,  3,  4,  5]]) \n",
      "Y: tensor([[17, 18, 19, 20, 21],\n",
      "        [ 2,  3,  4,  5,  6]])\n"
     ]
    }
   ],
   "source": [
    "my_seq = list(range(35))\n",
    "for X, Y in seq_data_iter_random(my_seq, batch_size=2, num_steps=5):\n",
    "    print('X: ', X, '\\nY:', Y)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T16:12:18.958534200Z",
     "start_time": "2023-05-11T16:12:18.945536Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [],
   "source": [
    "def seq_data_iter_sequential(corpus, batch_size, num_steps):  #@save\n",
    "    \"\"\"使⽤顺序分区⽣成⼀个⼩批量⼦序列\"\"\"\n",
    "    # 从随机偏移量开始划分序列\n",
    "    offset = random.randint(0, num_steps)\n",
    "    num_tokens = ((len(corpus) - offset - 1) // batch_size) * batch_size\n",
    "    Xs = torch.tensor(corpus[offset: offset + num_tokens])\n",
    "    Ys = torch.tensor(corpus[offset + 1: offset + 1 + num_tokens])\n",
    "    Xs, Ys = Xs.reshape(batch_size, -1), Ys.reshape(batch_size, -1)\n",
    "    num_batches = Xs.shape[1] // num_steps\n",
    "    for i in range(0, num_steps * num_batches, num_steps):\n",
    "        X = Xs[:, i: i + num_steps]\n",
    "        Y = Ys[:, i: i + num_steps]\n",
    "        yield X, Y"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T16:26:36.647893300Z",
     "start_time": "2023-05-11T16:26:36.626893300Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X:  tensor([[ 5,  6,  7,  8,  9],\n",
      "        [19, 20, 21, 22, 23]]) \n",
      "Y: tensor([[ 6,  7,  8,  9, 10],\n",
      "        [20, 21, 22, 23, 24]])\n",
      "X:  tensor([[10, 11, 12, 13, 14],\n",
      "        [24, 25, 26, 27, 28]]) \n",
      "Y: tensor([[11, 12, 13, 14, 15],\n",
      "        [25, 26, 27, 28, 29]])\n"
     ]
    }
   ],
   "source": [
    "for X, Y in seq_data_iter_sequential(my_seq, batch_size=2, num_steps=5):\n",
    "    print('X: ', X, '\\nY:', Y)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T16:26:39.619313400Z",
     "start_time": "2023-05-11T16:26:39.606312600Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "# 现在，我们将上⾯的两个采样函数包装到⼀个类中，以便稍后可以将其⽤作数据迭代器。"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [],
   "source": [
    "class SeqDataLoader:  #@save\n",
    "    \"\"\"加载序列数据的迭代器\"\"\"\n",
    "\n",
    "    def __init__(self, batch_size, num_steps, use_random_iter, max_tokens):\n",
    "        if use_random_iter:\n",
    "            self.data_iter_fn = d2l.seq_data_iter_random\n",
    "        else:\n",
    "            self.data_iter_fn = d2l.seq_data_iter_sequential\n",
    "        self.corpus, self.vocab = d2l.load_corpus_time_machine(max_tokens)\n",
    "        self.batch_size, self.num_steps = batch_size, num_steps\n",
    "\n",
    "        def __iter__(self):\n",
    "            return self.data_iter_fn(self.corpus, self.batch_size, self.num_steps)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T16:28:40.272426400Z",
     "start_time": "2023-05-11T16:28:40.267427Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [],
   "source": [
    "def load_data_time_machine(batch_size, num_steps,  #@save\n",
    "                           use_random_iter=False, max_tokens=10000):\n",
    "    \"\"\"返回时光机器数据集的迭代器和词表\"\"\"\n",
    "    data_iter = SeqDataLoader(\n",
    "        batch_size, num_steps, use_random_iter, max_tokens)\n",
    "    return data_iter, data_iter.vocab"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-11T16:29:13.249918200Z",
     "start_time": "2023-05-11T16:29:13.237917Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
